home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / ident / patches / smail3.1.28-tap-2Jun93.patch < prev    next >
Encoding:
Text File  |  1993-06-02  |  7.9 KB  |  265 lines

  1. Index: man/man5/smail.an
  2. Prereq: 1.37
  3. *** orig/man/man5/smail.an    Sun Sep 20 23:58:50 1992
  4. --- test/man/man5/smail.an    Tue Jun  1 16:46:14 1993
  5. ***************
  6. *** 348,353 ****
  7. --- 348,360 ----
  8.   likely by set to \fBsendmail\fP or \fBsmail\fP, depending upon the
  9.   program that typically is invoked for receiving mail.
  10.   .TP .8i
  11. + .B tap_ident_sender
  12. + The identification code of the user that sent the mail over its
  13. + last hop as determined by the TAP protocol.  This will generally
  14. + only be set for mail received by SMTP.  It is most useful for putting
  15. + into the \fBReceived:\fP header.  Only available if \fBHAVE_TAP\fP
  16. + was defined when building.
  17. + .TP .8i
  18.   .B uucp_name
  19.   the UUCP-network name for the local host.
  20.   .TP .8i
  21. ***************
  22. *** 1131,1136 ****
  23. --- 1138,1149 ----
  24.   attribute for more information.
  25.   .DD spool_mode number 0440
  26.   This defines the file creation mode for spool files.
  27. + .DD tap_query_timeout number -1
  28. + This defines the timeout for TAP identity queries on
  29. + incoming SMTP connections.  Values of zero or less
  30. + mean that no tap query is made (so queries are initially
  31. + disabled).   This is only available if TAP support is
  32. + compiled into your copy of smail.
  33.   .DD transport_file string "``transports''"
  34.   names the file containing the transport configuration
  35.   information.  If this does not begin with ``/'', it will be referenced
  36. Index: man/man8/smail.an
  37. Prereq: 1.8
  38. *** orig/man/man8/smail.an    Sun Aug  2 11:27:21 1992
  39. --- test/man/man8/smail.an    Tue Jun  1 16:46:15 1993
  40. ***************
  41. *** 534,539 ****
  42. --- 534,546 ----
  43.   Specify the protocol that was used by the sending host to deliver the
  44.   mail message.  This value can be included in expansion strings through
  45.   the variable \fB$sender_proto\fP.
  46. + .TP
  47. + \fB\-oMu\fP \fItap_ident_sender\fP
  48. + Specify the user that intitiated the message transfer on the previous
  49. + host to get to this host.  This value is set by the SMTP receiver when
  50. + a message is received from a host supporting the \fBTAP\fP protocol.
  51. + This value can be included in expansion strings through
  52. + the variable \fB$tap_ident_sender\fP.
  53.   .SH NORMAL USAGE
  54.   Under normal usage,
  55.   one smail daemon exists which receives requests from
  56. Index: src/config.c
  57. Prereq: 1.15
  58. *** orig/src/config.c    Wed Sep 16 17:10:21 1992
  59. --- test/src/config.c    Wed Jun  2 12:43:05 1993
  60. ***************
  61. *** 103,105 ****
  62. --- 103,106 ----
  63.   int tzoffset = 0;            /* glotznet host timezone offset */
  64.   int tznodst = 0;            /* glotznet does not have DST */
  65.   #endif /* GLOTZNET */
  66. + int tap_query_timeout = -1;        /* Timeout on TAP queries - initially disabled */
  67. Index: src/expand.c
  68. Prereq: 1.10
  69. *** orig/src/expand.c    Sun Sep 20 20:54:50 1992
  70. --- test/src/expand.c    Wed Jun  2 12:43:03 1993
  71. ***************
  72. *** 1104,1109 ****
  73. --- 1104,1112 ----
  74.       if (MATCH("sender_proto")) {
  75.       return sender_proto;
  76.       }
  77. +     if (MATCH("tap_ident_sender")) {
  78. +     return tap_ident_sender;
  79. +     }
  80.       if (MATCH("program")) {
  81.       return program;
  82.       }
  83. Index: src/extern.h
  84. Prereq: 1.34
  85. *** orig/src/extern.h    Mon Sep 21 02:44:04 1992
  86. --- test/src/extern.h    Wed Jun  2 12:43:00 1993
  87. ***************
  88. *** 97,102 ****
  89. --- 97,103 ----
  90.   extern int tzoffset;            /* timezone offset for glotznet host */
  91.   extern int tznodst;            /* true if no DST for glotznet host */
  92.   #endif /* GLOTZNET */
  93. + extern int tap_query_timeout;        /* Timeout on TAP queries */
  94.   
  95.   /* external variables defined in default.c */
  96.   extern struct director *directors;    /* configured directors */
  97. ***************
  98. *** 219,224 ****
  99. --- 220,228 ----
  100.   
  101.   /* external variables defined in route.c */
  102.   extern int cached_routers;        /* TRUE if cache_routers() called */
  103. + /* external variables defined in smtprecv.c */
  104. + extern char * tap_ident_sender;        /* The calculated identity of the sender */
  105.   
  106.   
  107.   /*
  108. Index: src/main.c
  109. Prereq: 1.24
  110. *** orig/src/main.c    Sun Sep 20 20:54:55 1992
  111. --- test/src/main.c    Wed Jun  2 12:42:57 1993
  112. ***************
  113. *** 1085,1090 ****
  114. --- 1085,1098 ----
  115.               sender_proto = arg;
  116.               break;
  117.   
  118. +             case 'u':
  119. +             if (*arg == '\0') {
  120. +                 arg = *args++;
  121. +                 panic_if_null(arg, "oMu");
  122. +             }
  123. +             tap_ident_sender = arg;
  124. +             break;
  125.               case 'P':
  126.               if (*arg == '\0') {
  127.                   arg = *args++;
  128. Index: src/queue.c
  129. Prereq: 1.22
  130. *** orig/src/queue.c    Sun Sep 20 20:55:05 1992
  131. --- test/src/queue.c    Wed Jun  2 12:42:54 1993
  132. ***************
  133. *** 283,288 ****
  134. --- 283,299 ----
  135.       }
  136.   
  137.       /*
  138. +      * write the ident of the sending person if known
  139. +      */
  140. +     if (tap_ident_sender) {
  141. +     if (put_line("-oMu") == FAIL ||
  142. +         put_line(tap_ident_sender) == FAIL)
  143. +     {
  144. +         return FAIL;
  145. +     }
  146. +     }
  147. +     /*
  148.        * write out the invoked program, too
  149.        */
  150.       if (put_line("-oMP") == FAIL ||
  151. ***************
  152. *** 1157,1163 ****
  153.       *p = '\0';
  154.       }
  155.   
  156. !     write_log(LOG_SYS, "received%s%s%s%s%s%s%s%s%s%s%s%ld%s",
  157.             "\n|\t     from: ", sender,
  158.           host_string?
  159.             "\n|\t     host: ": "", host_string? host_string: "",
  160. --- 1168,1174 ----
  161.       *p = '\0';
  162.       }
  163.   
  164. !     write_log(LOG_SYS, "received%s%s%s%s%s%s%s%s%s%s%s%ld%s%s%s",
  165.             "\n|\t     from: ", sender,
  166.           host_string?
  167.             "\n|\t     host: ": "", host_string? host_string: "",
  168. ***************
  169. *** 1166,1172 ****
  170.             "\n|\t  program: ", program,
  171.           trim_old_id?
  172.             "\n|\t  orig-id: ": "", trim_old_id? trim_old_id: "",
  173. !           "\n|\t     size: ", msg_size, " bytes");
  174.   
  175.       if (host_string) {
  176.       xfree(host_string);
  177. --- 1177,1185 ----
  178.             "\n|\t  program: ", program,
  179.           trim_old_id?
  180.             "\n|\t  orig-id: ": "", trim_old_id? trim_old_id: "",
  181. !           "\n|\t     size: ", msg_size, " bytes",
  182. !           tap_ident_sender? 
  183. !           "\n|\t   tap_id: ": "", tap_ident_sender? tap_ident_sender: "");
  184.   
  185.       if (host_string) {
  186.       xfree(host_string);
  187. Index: src/smailconf.c
  188. Prereq: 1.15
  189. *** orig/src/smailconf.c    Wed Sep 16 17:10:37 1992
  190. --- test/src/smailconf.c    Wed Jun  2 12:42:51 1993
  191. ***************
  192. *** 135,140 ****
  193. --- 135,141 ----
  194.       { "spool_mode", t_int, NULL, (tup *)&spool_mode, 0 },
  195.       { "switch_percent_and_bang", t_boolean, NULL,
  196.         (tup *)&switch_percent_and_bang, 0 },
  197. +     { "tap_query_timeout", t_int, NULL, (tup *)&tap_query_timeout, 0 },
  198.       { "transport_file", t_string, NULL, (tup *)&transport_file, 0 },
  199.       { "trusted", t_string, NULL, (tup *)&trusted, 0 },
  200.       { "trusted_users", t_string, NULL, (tup *)&trusted, 0 },
  201. Index: src/smtprecv.c
  202. Prereq: 1.16
  203. *** orig/src/smtprecv.c    Sun Sep  6 09:33:49 1992
  204. --- test/src/smtprecv.c    Wed Jun  2 12:42:47 1993
  205. ***************
  206. *** 28,36 ****
  207. --- 28,47 ----
  208.   # include "exitcodes.h"
  209.   #endif
  210.   
  211. + #ifdef HAVE_TAP
  212. + /* Include the declarations for TAP lookups */
  213. + #include <authuser.h>
  214. + #endif /* HAVE_TAP */
  215.   /* library functions */
  216.   extern long time();
  217.   
  218. + /* Declare the TAP variables - even if HAVE_TAP is not defined, so that configs
  219. +  * can be kept consistant
  220. +  */
  221. + char * tap_ident_sender = NULL;        /* The calculated identity of the sender */
  222.   /* types local to this file */
  223.   enum e_smtp_commands {
  224.       HELO_CMD,                /* HELO domain */
  225. ***************
  226. *** 159,164 ****
  227. --- 170,200 ----
  228.       putc('\n', out);
  229.       fflush(out);
  230.       }
  231. + #ifdef HAVE_TAP
  232. +     /* 
  233. +      * This code does a TAP/Ident/RFC1413 lookup on the connecting user (if possible)
  234. +      * Its here because this may cause a delay and it seems better to have the
  235. +      * delay once the connection is established rather than at the start
  236. +      */
  237. +     if (tap_query_timeout > 0) {    /* switch off TAP by setting timeout <= 0 */
  238. +     unsigned long inlocal;
  239. +     unsigned long inremote;
  240. +     unsigned short local;
  241. +     unsigned short remote;
  242. +     if (auth_fd2(fileno(in), &inlocal, &inremote, &local, &remote) == EOF) {
  243. +         /* 
  244. +          * You may want some error reporting here - however that 
  245. +          * may not be appropriate 
  246. +          */
  247. +         tap_ident_sender = NULL; /* Make sure ident is not set */
  248. +     } else {
  249. +         tap_ident_sender = auth_tcpuser3(inlocal, inremote, local, 
  250. +                          remote, tap_query_timeout);
  251. +     }
  252. +     }
  253. + #endif /* HAVE_TAP */
  254.   
  255.       while (! term_signal || out == NULL) {
  256.       if (out) {
  257.